import cv2
import numpy as np
img=cv2.imread('CV-Pictures/lena2.jpg',0)
# sobel_x=cv2.Sobel(img,-1,1,0)
# cv2.imshow('img',img)
sobel_x=cv2.Sobel(img,cv2.CV_64F,1,0)
sobel_y=cv2.Sobel(img,cv2.CV_64F,0,1)
sobel_x=cv2.convertScaleAbs(sobel_x)
sobel_y=cv2.convertScaleAbs(sobel_y)
sobel_xy=sobel_x+sobel_y
sobel_add_xy=cv2.addWeighted(sobel_x,0.5,sobel_y,0.5,0)
cv2.imshow('sobel_x',sobel_x)
cv2.imshow('sobel_y',sobel_y)
cv2.imshow('sobel_xy',sobel_xy)
cv2.imshow('sobel_add_xy',sobel_add_xy)
cv2.waitKey(0)
cv2.destroyAllWindows()



